#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    pid_t pid = getpid();
    char proc_status_file_name[30];
    sprintf(proc_status_file_name, "/proc/%d/status", pid);
    printf("%s\n",proc_status_file_name);
    FILE * fp = fopen(proc_status_file_name, "r");

    char name[1024];
    char num[1024];
    while(1)
    {
        
        fscanf(fp, "%s\t%s", num, name);
        if( feof(fp) )
        { 
            break ;
        }
        
        if (!strcmp("voluntary_ctxt_switches:", name))
        {
            printf("get : %s\n", num);
        }
        if (!strcmp("nonvoluntary_ctxt_switches:", name))
        {
            printf("get : %s\n", num);
        }
        printf("%s\t", name);
        printf("%s\n", num);

    }
    fclose(fp);
    return 0;
}